<?php

namespace app\admin\model;

use think\Model;


class Vip extends Model
{


    // 表名
    protected $name = 'vip';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'datetime';

    // 定义时间戳字段名
    protected $updateTime = false;
    protected $deleteTime = false;
    protected $resultSetType = 'collection';

    // 追加属性
    protected $append = [

    ];

    public function getImageAttr($name, $data)
    {
        return cdnurl( $data['image']); // TODO: Change the autogenerated stub
    }


    public function direct()
    {
        return $this->belongsTo('Direct', 'direct_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }
}
